package com.coffee.order.service.sku.dao;

import com.coffee.order.api.sku.query.OrderBalanceQuery;
import com.coffee.order.api.sku.result.OrderBalanceBackendResult;
import com.coffee.order.api.sku.result.OrderBalanceResult;
import com.coffee.order.service.sku.bean.OrderBalance;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderBalanceDao {
    public OrderBalance findById(Integer id);

    public OrderBalance findByOrderBalanceId(@Param("orderBalanceId")Integer orderBalanceId);

    public OrderBalance findByIdForUpdate(Integer id);

    public List<OrderBalance> findByIds(@Param("idList")List<Integer> idList);

    public Integer count(@Param("param")OrderBalanceQuery param);

    public Double sumRechargeMoney(@Param("param")OrderBalanceQuery param);

    public Integer countBank(@Param("param")OrderBalanceQuery param);

    public List<OrderBalance> page(@Param("param")OrderBalanceQuery param,@Param("offset")Integer offset,@Param("rows")Integer rows);

    public List<OrderBalance> list(@Param("param")OrderBalanceQuery param);

    public OrderBalance findFirst(@Param("param")OrderBalanceQuery param);

    public Integer insert(OrderBalance param);

    Integer insertBatch(List<OrderBalance> list);

    public Integer updateById(@Param("param")OrderBalance param);
    public Integer updateByOrderBalanceId(@Param("param")OrderBalance param);

    public Integer deleteById(Integer id);

    public Integer deleteByPayOrderId(Integer payOrderId);

    public Integer deleteByIds(List<Integer> idList);

    public List<OrderBalanceBackendResult> pageByBackend(@Param("param")OrderBalanceQuery param, @Param("offset")Integer offset, @Param("rows")Integer rows);

}